<%@ Page Title="" Language="C#" MasterPageFile="~/AddressBook.Master" AutoEventWireup="true" CodeBehind="MailingLabels.aspx.cs" Inherits="AddressBook.Web.MailingLabels" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainPaneContentPlaceHolder" runat="server">
	<asp:MultiView ID="MailingLabelsMultiView" runat="server" ActiveViewIndex="0">
		<asp:View ID="ReportSelectionView" runat="server">
			<div class="ReportSelection">
				<div class="ReportHeader">
					Print Mailing Labels
					<div style="float: right">
					  <asp:ImageButton ID="ReportSelectionRunImageButton" runat="server" ImageUrl="~/Images/run_report_16.png" AlternateText="Run Report" ToolTip="Run Report" OnClick="ReportSelectionRunImageButton_Click" />
					</div>
				</div>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td>Select Event</td>
						<td><asp:DropDownList ID="MailingEventList" runat="server" /></td>
					</tr>
					<tr>
						<td>Select Color</td>
						<td>
							<asp:DropDownList ID="ColorList" runat="server">
								<asp:ListItem Text="Black" Value="Black" />
								<asp:ListItem Text="Green" Value="Green" />
								<asp:ListItem Text="Red" Value="Red" />
							</asp:DropDownList>
						</td>
					</tr>
				</table>
			</div>
		</asp:View>
		<asp:View ID="ReportView" runat="server">
			<div class="MailingLabelPanel">
				<div class="MailingLabelHeader">
					Mailing Labels
					<div style="float: right;">
						<asp:HyperLink ID="DownloadTemplateLink" runat="server" ImageUrl="~/Images/mailmerge_template_16.png" ToolTip="Download MailMerge Template" NavigateUrl="~/Reports/MailingLabelsTemplate.docx" />
						<asp:HyperLink ID="DownloadDataLink" runat="server" ImageUrl="~/Images/download_data_16.png" ToolTip="Download MailMerge Data" NavigateUrl="~/Reports/MailingLabelHandler.ashx" />
						<asp:HyperLink ID="CloseReportLink" runat="server" ImageUrl="~/Images/close_16.png" NavigateUrl="~/MailingLabels.aspx" ToolTip="Close Report" />
					</div>
				</div>
				<div class="Report">
					<asp:DataList ID="MailingLabelsList" runat="server" 
												RepeatColumns="3" RepeatDirection="Horizontal" 
												DataSourceID="MailingLabelsDataSource" CellPadding="0" CellSpacing="0">
						<ItemTemplate>
							<div class="MailingLabel">
								<table border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td><%# Eval("Name") %></td>
									</tr>
									<tr>
										<td><%# Eval("Address1") %></td>
									</tr>
									<tr>
										<td><%# Eval("CityStateZip") %></td>
									</tr>
								</table>
							</div>
						</ItemTemplate>
						<SeparatorTemplate>
							<div style="width: 12px;"></div>
						</SeparatorTemplate>
					</asp:DataList>
					<asp:ObjectDataSource ID="MailingLabelsDataSource" runat="server" 
						SelectMethod="GetMailingLabels" 
						TypeName="AddressBook.Web.Reports.MailingLabelData">
						<SelectParameters>
							<asp:ControlParameter ControlID="MailingEventList" 
																		DefaultValue="1" 
																		Name="eventId" 
																		PropertyName="SelectedValue" 
																		Type="String" />
						</SelectParameters>
					</asp:ObjectDataSource>
				</div>
			</div>
		</asp:View>
	</asp:MultiView>
</asp:Content>
